package com.itxx.classLoading;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Loading2 {
    public static void main(String[] args) throws IOException {
        //使用getSystemClassLoader  获取一个类加载器
        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
        //调用getResourceAsStream  将数据使用流接收并封装为流
        InputStream is = classLoader.getResourceAsStream("prop.properties");
        //创建Properties对象
        Properties properties = new Properties();
        //用 load方法读取数据进Properties
        properties.load(is);
        is.close();

        System.out.println(properties);

    }
}
